<?php


namespace App\Resource\Gashapon\Draw;


use Illuminate\Http\Resources\Json\JsonResource;

class Resource extends JsonResource
{
    public function toArray($request)
    {
        return [
            'id' => $this->gift->id ?? null,
            'name' => $this->gift->name ?? null,
            'image' => $this->gift->picture ?? null,
            'price' => $this->gift->price ?? null,
            'count' => $this->count,
            'total_price' => $this->gift->price ?? $this->gift->price * $this->count,
        ];
    }
}
